package com.web.base.user.dao;

import org.springframework.stereotype.Repository;
import com.blue.jdbc.BaseDao;
import com.web.base.user.model.BankCard;

/**
 * 银行卡数据库访问
 * 
 * @author 代码由 blue-code 框架生成
 * @since 1.0 2018年06月26日
 */
@Repository("userBankCardDao")
public class BankCardDao extends BaseDao<BankCard>
{
	public BankCardDao()
	{
	}
	
	@Override
	protected void query(StringBuilder sql, BankCard param)
	{
		if (param != null)
		{
			if (param.getUserId() != null && param.getUserId() > 0)
				sql.append(" and a.user_id=:userId");
				
			if (param.getBankId() != null && param.getBankId() > 0)
				sql.append(" and a.bank_id=:bankId");
				
			if (param.getState() != null)
				sql.append(" and a.state=:state");
				
			if (param.getAuth() != null)
				sql.append(" and a.auth=:auth");
				
		}
		sql.append(" order by a.id desc");
	}
	
}
